package com.java.simple.study.spi;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @author zhoujunlin
 * @date 2023年05月09日 14:11
 * @desc
 */
public class TestSPI {

    public static void main(String[] args) {
        ServiceLoader<Search> serviceLoader = ServiceLoader.load(Search.class);
        Iterator<Search> searchIterator = serviceLoader.iterator();
        while (searchIterator.hasNext()) {
            Search search = searchIterator.next();
            search.find("testSPI");
        }
    }

}
